import { apiResquest } from '@/utils/request.js'
// 获取用户个人信息
export const userInfo = (query) => {
	return apiResquest({
		url: `/api/user/detail/${query}`,
		method: 'get',
	})
}
export const updateUser = (query,data) => {
	return apiResquest({
		url: `/api/user/${query}`,
		method: 'put',
		data:data
	})
}
// 录入健康数据
export const health = (query) => {
	return apiResquest({
		url: "/api/user/body",
		method: 'put',
		data:query
	})
}
// 查询收藏的课程信息
export const courese = (query) => {
	return apiResquest({
		url: "/api/course/collect",
		method: 'get',
		data:query
	})
}
// 收藏课程
export const collect = (query) => {
	return apiResquest({
		url: "/api/course/collect",
		method: 'post',
		data:query,
		header:{
			"content-type":" application/x-www-form-urlencoded "
		}
	})
}
// 取消搜藏
export const cancelCollect = (query) => {
	return apiResquest({
		url: "/api/course/collect/cancel",
		method: 'post',
		data:query,
		header:{
			"content-type":" application/x-www-form-urlencoded "
		}
	})
}
// 取消关注课程
export const cancel = () => {
	return apiResquest({
		url: "/api/course/collect/cancel",
		method: 'post',
		header:{
			"content-type":" application/x-www-form-urlencoded "
		}
	})
}
// 关注教练
export const followCoarsh = () => {
	return apiResquest({
		url: `/api/user/follow`,
		method: 'put',
		header:{
			"content-type":" application/x-www-form-urlencoded "
		}
	})
}
// 取消关注
export const unfollow = (query) => {
	return apiResquest({
		url: `/api/user/unfollow/${query}`,
		method: 'put',
		header:{
			"content-type":" application/x-www-form-urlencoded "
		}
	})
}
// 获取我收藏的课程列表
export const collectList = (query) => {
	return apiResquest({
		url: `/api/course/collect`,
		method: 'get',
		header:{
			"content-type":" application/x-www-form-urlencoded "
		}
	})
}